/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package simsimframework.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import simsimframework.Chart;
import simsimframework.Function;
import simsimframework.Gateway;
import simsimframework.Network;
import simsimframework.SIMULATOR;
import simsimframework.SimsimframeworkPackage;
import simsimframework.Transition;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>SIMULATOR</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link simsimframework.impl.SIMULATORImpl#getContains_networks <em>Contains networks</em>}</li>
 *   <li>{@link simsimframework.impl.SIMULATORImpl#getContains_transitions <em>Contains transitions</em>}</li>
 *   <li>{@link simsimframework.impl.SIMULATORImpl#getContains_gateway <em>Contains gateway</em>}</li>
 *   <li>{@link simsimframework.impl.SIMULATORImpl#getContains_dataprocessings <em>Contains dataprocessings</em>}</li>
 *   <li>{@link simsimframework.impl.SIMULATORImpl#getContains_charts <em>Contains charts</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class SIMULATORImpl extends EObjectImpl implements SIMULATOR {
	/**
	 * The cached value of the '{@link #getContains_networks() <em>Contains networks</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContains_networks()
	 * @generated
	 * @ordered
	 */
	protected EList<Network> contains_networks;

	/**
	 * The cached value of the '{@link #getContains_transitions() <em>Contains transitions</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContains_transitions()
	 * @generated
	 * @ordered
	 */
	protected EList<Transition> contains_transitions;

	/**
	 * The cached value of the '{@link #getContains_gateway() <em>Contains gateway</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContains_gateway()
	 * @generated
	 * @ordered
	 */
	protected EList<Gateway> contains_gateway;

	/**
	 * The cached value of the '{@link #getContains_dataprocessings() <em>Contains dataprocessings</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContains_dataprocessings()
	 * @generated
	 * @ordered
	 */
	protected EList<Function> contains_dataprocessings;

	/**
	 * The cached value of the '{@link #getContains_charts() <em>Contains charts</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getContains_charts()
	 * @generated
	 * @ordered
	 */
	protected EList<Chart> contains_charts;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected SIMULATORImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return SimsimframeworkPackage.Literals.SIMULATOR;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Network> getContains_networks() {
		if (contains_networks == null) {
			contains_networks = new EObjectContainmentEList<Network>(Network.class, this, SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS);
		}
		return contains_networks;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Transition> getContains_transitions() {
		if (contains_transitions == null) {
			contains_transitions = new EObjectContainmentEList<Transition>(Transition.class, this, SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS);
		}
		return contains_transitions;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Gateway> getContains_gateway() {
		if (contains_gateway == null) {
			contains_gateway = new EObjectContainmentEList<Gateway>(Gateway.class, this, SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY);
		}
		return contains_gateway;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Function> getContains_dataprocessings() {
		if (contains_dataprocessings == null) {
			contains_dataprocessings = new EObjectContainmentEList<Function>(Function.class, this, SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS);
		}
		return contains_dataprocessings;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Chart> getContains_charts() {
		if (contains_charts == null) {
			contains_charts = new EObjectContainmentEList<Chart>(Chart.class, this, SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS);
		}
		return contains_charts;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS:
				return ((InternalEList<?>)getContains_networks()).basicRemove(otherEnd, msgs);
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS:
				return ((InternalEList<?>)getContains_transitions()).basicRemove(otherEnd, msgs);
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY:
				return ((InternalEList<?>)getContains_gateway()).basicRemove(otherEnd, msgs);
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS:
				return ((InternalEList<?>)getContains_dataprocessings()).basicRemove(otherEnd, msgs);
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS:
				return ((InternalEList<?>)getContains_charts()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS:
				return getContains_networks();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS:
				return getContains_transitions();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY:
				return getContains_gateway();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS:
				return getContains_dataprocessings();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS:
				return getContains_charts();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS:
				getContains_networks().clear();
				getContains_networks().addAll((Collection<? extends Network>)newValue);
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS:
				getContains_transitions().clear();
				getContains_transitions().addAll((Collection<? extends Transition>)newValue);
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY:
				getContains_gateway().clear();
				getContains_gateway().addAll((Collection<? extends Gateway>)newValue);
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS:
				getContains_dataprocessings().clear();
				getContains_dataprocessings().addAll((Collection<? extends Function>)newValue);
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS:
				getContains_charts().clear();
				getContains_charts().addAll((Collection<? extends Chart>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS:
				getContains_networks().clear();
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS:
				getContains_transitions().clear();
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY:
				getContains_gateway().clear();
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS:
				getContains_dataprocessings().clear();
				return;
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS:
				getContains_charts().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_NETWORKS:
				return contains_networks != null && !contains_networks.isEmpty();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_TRANSITIONS:
				return contains_transitions != null && !contains_transitions.isEmpty();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_GATEWAY:
				return contains_gateway != null && !contains_gateway.isEmpty();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_DATAPROCESSINGS:
				return contains_dataprocessings != null && !contains_dataprocessings.isEmpty();
			case SimsimframeworkPackage.SIMULATOR__CONTAINS_CHARTS:
				return contains_charts != null && !contains_charts.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //SIMULATORImpl
